home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Miami / MiamiSDK / netinclude / netinet / ip_mroute.h < prev    next >
C/C++ Source or Header  |  1997-12-28  |  3KB  |  92 lines

  1. #ifndef _NETINET_IP_MROUTE_H_
  2. #define _NETINET_IP_MROUTE_H_
  3.  
  4. #ifndef _SYS_TYPES_H_
  5. #include <sys/types.h>
  6. #endif
  7.  
  8. #ifndef _NETINET_IN_H_
  9. #include <netinet/in.h>
  10. #endif
  11.  
  12. /*
  13.  * Multicast Routing set/getsockopt commands.
  14.  */
  15. #define    MRT_INIT    100    /* initialize forwarder */
  16. #define    MRT_DONE    101    /* shut down forwarder */
  17. #define    MRT_ADD_VIF    102    /* create virtual interface */
  18. #define    MRT_DEL_VIF    103    /* delete virtual interface */
  19. #define MRT_ADD_MFC    104    /* insert forwarding cache entry */
  20. #define MRT_DEL_MFC    105    /* delete forwarding cache entry */
  21. #define MRT_VERSION    106    /* get kernel version number */
  22. #define MRT_ASSERT      107     /* enable PIM assert processing */
  23.  
  24.  
  25. /*
  26.  * Types and macros for handling bitmaps with one bit per virtual interface.
  27.  */
  28. #define    MAXVIFS 32
  29. typedef u_long vifbitmap_t;
  30. typedef u_short vifi_t;        /* type of a vif index */
  31. #define ALL_VIFS (vifi_t)-1
  32.  
  33. #define    VIFM_SET(n, m)        ((m) |= (1 << (n)))
  34. #define    VIFM_CLR(n, m)        ((m) &= ~(1 << (n)))
  35. #define    VIFM_ISSET(n, m)    ((m) & (1 << (n)))
  36. #define    VIFM_CLRALL(m)        ((m) = 0x00000000)
  37. #define    VIFM_COPY(mfrom, mto)    ((mto) = (mfrom))
  38. #define    VIFM_SAME(m1, m2)    ((m1) == (m2))
  39.  
  40.  
  41. /*
  42.  * Argument structure for MRT_ADD_VIF.
  43.  * (MRT_DEL_VIF takes a single vifi_t argument.)
  44.  */
  45. struct vifctl {
  46.     vifi_t    vifc_vifi;            /* the index of the vif to be added */
  47.     u_char    vifc_flags;         /* VIFF_ flags defined below */
  48.     u_char    vifc_threshold;     /* min ttl required to forward on vif */
  49.     u_int    vifc_rate_limit;    /* max rate */
  50.     struct    in_addr vifc_lcl_addr;    /* local interface address */
  51.     struct    in_addr vifc_rmt_addr;    /* remote address (tunnels only) */
  52. };
  53.  
  54. #define    VIFF_TUNNEL    0x1        /* vif represents a tunnel end-point */
  55. #define VIFF_SRCRT    0x2        /* tunnel uses IP source routing */
  56.  
  57. /*
  58.  * Argument structure for MRT_ADD_MFC and MRT_DEL_MFC
  59.  * (mfcc_tos to be added at a future point)
  60.  */
  61. struct mfcctl {
  62.     struct in_addr  mfcc_origin;        /* ip origin of mcasts       */
  63.     struct in_addr  mfcc_mcastgrp;         /* multicast group associated*/
  64.     vifi_t        mfcc_parent;           /* incoming vif              */
  65.     u_char        mfcc_ttls[MAXVIFS];     /* forwarding ttls on vifs   */
  66. };
  67.  
  68. /*
  69.  * Argument structure used by mrouted to get src-grp pkt counts
  70.  */
  71. struct sioc_sg_req {
  72.     struct in_addr src;
  73.     struct in_addr grp;
  74.     u_long pktcnt;
  75.     u_long bytecnt;
  76.     u_long wrong_if;
  77. };
  78.  
  79. /*
  80.  * Argument structure used by mrouted to get vif pkt counts
  81.  */
  82. struct sioc_vif_req {
  83.     vifi_t vifi;        /* vif number                */
  84.     u_short pad1;        /* force natural alignment    */
  85.     u_long icount;        /* Input packet count on vif        */
  86.     u_long ocount;        /* Output packet count on vif        */
  87.     u_long ibytes;        /* Input byte count on vif        */
  88.     u_long obytes;        /* Output byte count on vif        */
  89. };
  90.  
  91. #endif /* _NETINET_IP_MROUTE_H_ */
  92.